package com.etoak.controller.advice;

import com.etoak.commons.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {


    @ExceptionHandler(RuntimeException.class)
    public ResultVO handle (RuntimeException  e){
     log.error(e.getMessage(),e);
     return  ResultVO.error(e.getMessage());
    }


}
